package com.yao.mytest;

import com.yao.spider.core.util.HttpClientUtil;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;

/**
 * Created by 单耀 on 2017/12/10.
 */
public class ProxyDownLoadTask implements Runnable{
    private static Logger logger = LoggerFactory.getLogger(ProxyDownLoadTask.class);
    private String url;
    public ProxyDownLoadTask(){

    }

    public ProxyDownLoadTask(String url){
        this.url = url;
    }

    public void run() {
        try {
            CloseableHttpResponse response = HttpClientUtil.getResponse(url);
            InputStream c = response.getEntity().getContent();
            String context = EntityUtils.toString( response.getEntity(),"utf-8");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
